package structurepattern.adapter;

public class AudioPlayer implements MediaPlayer {
	MediaAdapter adapter;
	
	@Override
	public void play(String type, String fileName) {
		if(type.equalsIgnoreCase("mp3")) {
			System.out.println("Playing mp3 file: " + fileName);
		}
		else if(type.equalsIgnoreCase("vlc") || type.equalsIgnoreCase("mp4")) {
			adapter = new MediaAdapter(type);
			adapter.play(type, fileName);
		}
		else {
			System.out.println("invalid media type: " + type);
		}
	}
}
